package com.ruoyi.web.controller.module;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.framework.web.service.SysLoginService;
import com.ruoyi.framework.web.service.SysPermissionService;
import com.ruoyi.system.mapper.SysOperLogMapper;
import com.ruoyi.system.service.ISysDictTypeService;
import com.ruoyi.system.service.impl.SysUserServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * App用户信息Controller
 *
 * @author Cullen
 * @date 2023-02-10
 */
@Api(tags = "App用户信息")
@RestController
@RequestMapping("/module/user")
public class AppUserController extends BaseController {

    @Autowired
    private SysLoginService loginService;

    @Anonymous
    @ApiOperation("签发临时token-只能使用一次")
    @GetMapping("/temporaryTokenJustOnce")
    public AjaxResult temporaryTokenJustOnce(@RequestParam Long userId) {
        return AjaxResult.success(loginService.temporaryTokenJustOnce(userId));
    }


//    @Anonymous
//    @ApiOperation("签发临时token-1分钟")
//    @PostMapping("/temporaryToken")
//    public AjaxResult temporaryToken(@RequestBody PhonePo po) {
//        return AjaxResult.success(loginService.temporaryToken(po.getPhone()));
//    }
//
//    @Anonymous
//    @ApiOperation("App一键登录")
//    @PostMapping("/appLogin")
//    public AjaxResult appLogin(@RequestBody AppLoginPo po) {
//        return AjaxResult.success().put(Constants.Data, loginService.appLogin(po));
//    }
//
//    @Anonymous
//    @ApiOperation("微信-登录")
//    @GetMapping("/wxLogin")
//    public AjaxResult wxLogin(String openId) {
//        return AjaxResult.success().put(Constants.Data, loginService.getUserByOpenId(openId));
//    }
//
//    @Anonymous
//    @ApiOperation("微信-注册")
//    @PostMapping("/wxRegister")
//    public AjaxResult wxRegister(@Validated @RequestBody WxLoginPo po) {
//        return AjaxResult.success().put(Constants.Data, loginService.wxRegister(po));
//    }
//
//    @ApiOperation("微信-小程序-注册")
//    @PostMapping("/wxAppletRegister")
//    public AjaxResult wxAppletRegister(@Validated @RequestBody WxLoginPo po) {
//        return AjaxResult.success().put(Constants.Data, loginService.wxAppletRegister(po));
//    }


}
